import os
from script_convert_rating import movielens_1m_ratings, lastfm_ratings, epinions_ratings, filter_unused_data, netflix_ratings, pinterest_ratings
import pandas as pd


if __name__ == '__main__':
    input_dir = os.path.join('/home', 'zhengbian', 'Dataset', 'Recommendation')
    output_dir = os.path.join('/home', 'zhengbian', 'rec2-mips', 'intermediate-rating-csv')

    # ml_input = os.path.join(input_dir, 'ml-1m', 'ml-1m.inter')
    # ml_output = os.path.join(output_dir, 'ml-1m.csv')
    # movielens_1m_ratings.convert_ratings(ml_input, ml_output)
    #
    # lastfm_input = os.path.join(input_dir, 'lastfm', 'lastfm.inter')
    # lastfm_output = os.path.join(output_dir, 'lastfm.csv')
    # lastfm_ratings.convert_ratings(lastfm_input, lastfm_output)

    # epinions_input = os.path.join(input_dir, 'epinions', 'epinions.inter')
    # epinions_output = os.path.join(output_dir, 'epinions.csv')
    # epinions_ratings.convert_ratings(epinions_input, epinions_output)

    # epinions_input = os.path.join(input_dir, 'epinions', 'epinions.inter')
    # epinions_output = os.path.join(output_dir, 'epinions_sample.csv')
    # epinions_ratings.convert_ratings_sample(epinions_input, epinions_output, n_sample_user=8000, n_sample_item=2000)

    # netflix_input = os.path.join(input_dir, 'netflix', 'netflix.inter')
    # netflix_output = os.path.join(output_dir, 'netflix_sample.csv')
    # netflix_ratings.convert_ratings_sample(netflix_input, netflix_output, n_sample_user=8000, n_sample_item=2000)

    pinterest_input = os.path.join(input_dir, 'pinterest', 'pinterest.inter')
    pinterest_output = os.path.join(output_dir, 'pinterest.csv')
    pinterest_ratings.convert_ratings(pinterest_input, pinterest_output)
